local ls_name = 'lua-language-server'

-- vim.lsp.enable(ls_name) -- this has problems. It'll attach to all buffers which I can't handle
vim.api.nvim_create_autocmd("FileType", {
  pattern = "lua",
  callback = function()
    vim.lsp.start(vim.lsp.config["lua-language-server"])
  end,
})

vim.lsp.config[ls_name] = {
  cmd = { 'lua-language-server' },
  filetype = { 'lua' },
  root_markers = {
    '.luarc.json',
    '.luarc.jsonc',
    '.luacheckrc',
    '.stylua.toml',
    'stylua.toml',
    'selene.toml',
    'selene.yml',
    '.git',
  },
}
